﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;
using System.ComponentModel;
using Lib.Web.Mvc.JQuery.JqGrid.DataAnnotations;

namespace Stertex.Models
{
    public class ProfileEditModel : ProfileViewModel
    {
        public int id { get; set; }
        public string oper { get; set; }
    }

    public class ProfileViewModel
    {
        [JqGridColumnEditable(true)]
        public string Firstname { get; set; }
        [JqGridColumnEditable(true)]
        public string Lastname { get; set; }

        [JqGridColumnEditable(true)]
        [JqGridColumnLabel(Label="Job Title")]
        public string Title { get; set; }

        [JqGridColumnEditable(true)]
        public string Company { get; set; }

        [JqGridColumnEditable(true)]
        public string Address { get; set; }

        [JqGridColumnEditable(true)]
        public string City { get; set; }

        [JqGridColumnEditable(true)]
        public string State { get; set; }
        [HiddenInput]
        [JqGridColumnEditable(true)]
       
        
        public int ProfileID { get; set; }

        [JqGridColumnEditable(true)]
        [JqGridColumnLabel(Label="Zip Code")]
        public string Zip { get; set; }

        [JqGridColumnEditable(true)]
        public string Phone { get; set; }

        #region Properties
        

        #endregion

         public ProfileViewModel() {}
        public ProfileViewModel(Repository.Profile p)
        {
            // TODO: Complete member initialization
            this.Firstname = p.Firstname;
            this.Lastname = p.Lastname;
            this.Title =p.Title;
            this.Company = p.Company;
            this.Address = p.Address;
            this.City = p.City;
            this.Phone = p.Phone;
            this.State = p.State;
            this.Zip = p.Zip;
            this.ProfileID = p.ProfileID;
        }

        
    }
    public class ChangePasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Current password")]
        public string OldPassword { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "New password")]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm new password")]
        [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }
    }

    public class LogOnModel
    {
        [Required]
        [Display(Name = "User name")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [Display(Name = "Remember me?")]
        public bool RememberMe { get; set; }
    }

    public class RegisterModel
    {
        [Required]
        [Display(Name = "User name")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Email address")]
        public string Email { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm password")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }
    }
    public class ProfileRegistrationModel
    {
        [Required(ErrorMessage="*")]
        public string Email { get; set; }

        [Required(ErrorMessage = "*")]
        public string Firstname { get; set; }

        [Required(ErrorMessage = "*")]
        public string Lastname { get; set; }
        public string Phone { get; set; }
        public string Address { get; set; }
        public string Company { get; set; }
        [Display(Name="Job Title")]
        public string Title { get; set; }
        public string State { get; set; }
        public string City { get; set; }
        [Required]
        public string Zip { get; set; }

       
    }
    public class GeneratePasswordModel
    {
        [Required(ErrorMessage = "*")]
        [DataType(DataType.Password)]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Compare("Password", ErrorMessage = "confirmation password doesn't match.")]
        public string ConfirmPassword { get; set; }

        [HiddenInput]
        public string Key { get; set; }
    }
}
